package top.codetheory._01_动态数组;

public class Main {
    public static void main(String[] args) {
        ArrayList<Object> list  = new ArrayList<>();
        list.add(10);
        list.add(new Person(10, "Jack"));
        list.add(22);

        System.out.println(list.indexOf(new Person(10, "Jack")));  // 1


		ArrayList<Object> persons  = new ArrayList<>();
		persons.add(new Person(10, "Jack"));
		persons.add(null);
		persons.add(new Person(15, "Rose"));
		persons.add(null);
		persons.add(new Person(12, "James"));
		persons.add(null);

		System.out.println(persons.indexOf(null));  // 1


        ArrayList<Person> arrayList  = new ArrayList<>();
        arrayList.add(new Person(10, "Jack"));
        arrayList.add(new Person(12, "James"));
        arrayList.add(new Person(15, "Rose"));
        arrayList.clear();
        arrayList.add(new Person(22, "abc"));

        System.out.println(arrayList);
        ArrayList<Integer> ints  = new ArrayList<>();
        ints.add(10);
        ints.add(10);
        ints.add(22);
        ints.add(33);
        System.out.println(ints);
    }
}
